Set Table

  • In Teradata transaction mode, the default, however, is a SET table that does not permit duplicate rows. 
  • A set table force to check for the duplicate rows every time a new row is inserted or updated into the table. 
  • There is a negative performance impact for SET tables. Each time a row is inserted or updated, Teradata checks if this would violate row uniqueness. This test is called DUPLICATE ROW CHECK.
  • If we are inserting data using INSERT into SEL from clause then SET table check for duplicate rows will removed automatically and there will be no DUPLICATE ROW ERROR.​
  • If you are using any GROUP BY or QUALIFY statement on the source table then it’s highly recommended to define target table as MULTISET. As GROUP BY and QUALIFY will remove the duplicate records from the source.​
  • If the source table has UPI (Unique Primary Index) then also there is no need of SET target table. As UPI will never allows duplicate PI in the same table.​So with the help of little bit of awareness about SET and MULTISET we can save a lot of time while loading the table.​
Note:- Remember that SET table causes an additional overhead of checking for the duplicate records. So we need to follow few points to save Teradata from this additional overhead.​If you do not specify SET or MULTISET, the default table kind depends on the session mode. In ANSI session mode, the default table kind is MULTISET. Duplicate rows are allowed. In Teradata session mode, the default table kind is SET.

No comments:

Post a Comment